home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / basic / mildred / lha / landtest1.lha / LandTest.ascii < prev    next >
Text File  |  1998-12-13  |  2KB  |  100 lines

  1. WBStartup
  2. #Width=320
  3. #Height=240
  4. MCPU Processor
  5. Mc2pCPUmode Processor
  6. InitBank 0,(2240+#Width)*60,$10002
  7. CludgeBitMap 0,2240+#Width,60,8,Bank(0)
  8. InitPalette 0,256
  9. LoadBitMap 0,"Land7.iff",0
  10. MReserveBitmaps 2
  11. MBitmap 0,2240+#Width,60
  12. MPlanar16ToBitmap 0,Bank(0),2240,60,2240+#Width,60
  13. MBlockScroll 0,0,#Width,60,2240,0,0
  14. MReserveShapes 1
  15. MGetaShape 0,0,4,16,8
  16. MBitmap 1,#Width,#Height
  17. InitBank 0,#Width*#Height,$10002
  18. CludgeBitMap 0,#Width,#Height,8,Bank(0)
  19. Screen 0,8,0,#Width,#Height,8,0,"",0,0,0
  20. ShowPalette 0
  21. Cls 0
  22. MReservec2pWindows 1
  23. Mc2pWindow 0,#Width,#Height
  24. MReserveQueues 1
  25. MQueue 0,1
  26. speedsetting.q=1 ; Global speed multiplier
  27. xpos.q=0
  28. xaccelerate.q=0.75*speedsetting
  29. xmomentum.q=0
  30. xairresistance.q=0.1*speedsetting
  31. xmaxspeed.q=16*speedsetting
  32. ypos.q=(#Height-69)/2
  33. yaccelerate.q=0.65*speedsetting
  34. ymomentum.q=0
  35. ymaxspeed.q=10*speedsetting
  36. ytopdampen.q=1.9
  37. ybottomdampen.q=1.65
  38. ygravity.q=0.15
  39. cnt.l=0
  40. ResetTimer
  41. While Joyb(1)=0
  42.  
  43.   jh=JHoriz(1)
  44.   jv=JVert(1)
  45.  
  46.   xmomentum+(xaccelerate*jh)
  47.   ymomentum+(yaccelerate*jv)
  48.  
  49.   ymomentum+ygravity
  50.   If xmomentum>0
  51.     xmomentum-xairresistance
  52.     If xmomentum<0 Then xmomentum=0
  53.   Else
  54.     xmomentum+xairresistance
  55.     If xmomentum>0 Then xmomentum=0
  56.   EndIf
  57.  
  58.   If xmomentum>xmaxspeed Then xmomentum=xmaxspeed
  59.   If xmomentum<-xmaxspeed Then xmomentum=-xmaxspeed
  60.   If ymomentum>ymaxspeed Then ymomentum=ymaxspeed
  61.   If ymomentum<-ymaxspeed Then ymomentum=-ymaxspeed
  62.  
  63.   xpos+xmomentum
  64.   ypos+ymomentum
  65.  
  66.   If ypos<0
  67.     ymomentum=-ymomentum/ytopdampen
  68.     ypos=0
  69.   EndIf
  70.   If ypos>#Height-69
  71.     ymomentum=-ymomentum/ybottomdampen
  72.     ypos=#Height-69
  73.   EndIf
  74.  
  75.   If xpos<0 Then xpos=2240+xpos
  76.   If xpos>=2240 Then xpos-2240
  77.  
  78.   cnt+1
  79. ;  MScroll xpos,0,#Width,60,0,#Height-61,0
  80. mult.q=1.0
  81. For y=0 To 59
  82.   x=xpos*mult
  83.   If x>2239 Then x-2240
  84.   If x<0 Then x+2240
  85.   MScroll x,y,#Width,1,0,#Height-61+y,0
  86.   mult*1.01
  87. Next y
  88.   MQBlit 0,0,160-8,ypos
  89.   Mc2p Bank(0)
  90.   MUnQueue 0
  91.   VWait
  92. Wend
  93. ;t=Timer
  94. ;a.q=50.0/(t/cnt)
  95. ;NPrint a
  96. ;VWait 50
  97. ;MouseWait
  98. End
  99.  
  100.